home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 32 / Mac Magazin and MacEasy Magazine CD - Issue 32.iso / Grafik & Text / OzTeX3.0 / TeX-inputs / LaTeX / tools / array.sty < prev    next >
Text File  |  1997-03-07  |  13KB  |  360 lines

  1. %%
  2. %% This is file `array.sty',
  3. %% generated with the docstrip utility.
  4. %%
  5. %% The original source files were:
  6. %%
  7. %% array.dtx  (with options: `package,ncols')
  8. %% 
  9. %% IMPORTANT NOTICE:
  10. %% 
  11. %% This file is a generated file from the sources of the `tools' bundle
  12. %% in the LaTeX2e distribution.
  13. %% 
  14. %% For the copyright notice see the source file(s).
  15. %% 
  16. %% You are not allowed to modify this file.
  17. %% 
  18. %% You are allowed to distribute this file if and only if
  19. %% it is distributed with the corresponding source files in
  20. %% the `tools' bundle.
  21. %% 
  22. %% For the copying and distribution conditions of the source files,
  23. %% see the file readme.txt distributed with the tools bundle.
  24. %% 
  25. %% Package `array' to use with LaTeX 2e
  26. %% Copyright (C) 1989-1996 Frank Mittelbach, all rights reserved.
  27. \NeedsTeXFormat{LaTeX2e}[1995/06/01]
  28. \ProvidesPackage{array}
  29.          [1996/06/14 v2.3i Tabular extension package (FMi)]
  30. %% \CharacterTable
  31. %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
  32. %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
  33. %%   Digits        \0\1\2\3\4\5\6\7\8\9
  34. %%   Exclamation   \!     Double quote  \"     Hash (number) \#
  35. %%   Dollar        \$     Percent       \%     Ampersand     \&
  36. %%   Acute accent  \'     Left paren    \(     Right paren   \)
  37. %%   Asterisk      \*     Plus          \+     Comma         \,
  38. %%   Minus         \-     Point         \.     Solidus       \/
  39. %%   Colon         \:     Semicolon     \;     Less than     \<
  40. %%   Equals        \=     Greater than  \>     Question mark \?
  41. %%   Commercial at \@     Left bracket  \[     Backslash     \\
  42. %%   Right bracket \]     Circumflex    \^     Underscore    \_
  43. %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
  44. %%   Right brace   \}     Tilde         \~}
  45. %%
  46.  
  47. \def\@addtopreamble#1{\xdef\@preamble{\@preamble #1}}
  48. \def\@testpach{\@chclass
  49.  \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
  50.   \ifnum \@lastchclass=7 5 \else
  51.    \ifnum \@lastchclass=8 \tw@ \else
  52.     \ifnum \@lastchclass=9 \thr@@
  53.    \else \z@
  54.    \ifnum \@lastchclass = 10 \else
  55.    \edef\@nextchar{\expandafter\string\@nextchar}%
  56.    \@chnum
  57.    \if \@nextchar c\z@ \else
  58.     \if \@nextchar l\@ne \else
  59.      \if \@nextchar r\tw@ \else
  60.    \z@ \@chclass
  61.    \if\@nextchar |\@ne \else
  62.     \if \@nextchar !6 \else
  63.      \if \@nextchar @7 \else
  64.       \if \@nextchar <8 \else
  65.        \if \@nextchar >9 \else
  66.   10
  67.   \@chnum
  68.   \if \@nextchar m\thr@@\else
  69.    \if \@nextchar p4 \else
  70.     \if \@nextchar b5 \else
  71.    \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
  72.    \fi \fi  \fi  \fi  \fi  \fi  \fi \fi \fi \fi \fi \fi}
  73. \def\@xexpast#1*#2#3#4\@@{%
  74.    \@tempcnta #2
  75.    \toks@={#1}\@temptokena={#3}%
  76.    \let\the@toksz\relax \let\the@toks\relax
  77.    \def\@tempa{\the@toksz}%
  78.    \ifnum\@tempcnta >0 \@whilenum\@tempcnta >0\do
  79.      {\edef\@tempa{\@tempa\the@toks}\advance \@tempcnta \m@ne}%
  80.        \let \@tempb \@xexpast \else
  81.        \let \@tempb \@xexnoop \fi
  82.    \def\the@toksz{\the\toks@}\def\the@toks{\the\@temptokena}%
  83.    \edef\@tempa{\@tempa}%
  84.    \expandafter \@tempb \@tempa #4\@@}
  85. \def\prepnext@tok{\advance \count@ \@ne
  86.    \toks\count@{}}
  87. \def\save@decl{\toks\count@ \expandafter{\@nextchar}}
  88. \def\insert@column{%
  89.    \the@toks \the \@tempcnta
  90.    \ignorespaces \@sharp \unskip
  91.    \the@toks \the \count@ \relax}
  92. \newdimen\col@sep
  93. \def\@acol{\@addtopreamble{\hskip\col@sep}}
  94. \def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue
  95.    \let\@sharp\relax \let\@startpbox\relax \let\@endpbox\relax
  96.    \@xexpast #1*0x\@@
  97.    \count@\m@ne
  98.    \let\the@toks\relax
  99.    \prepnext@tok
  100.    \expandafter \@tfor \expandafter \@nextchar
  101.     \expandafter :\expandafter =\@tempa \do
  102.    {\@testpach
  103.    \ifcase \@chclass \@classz \or \@classi \or \@classii
  104.      \or \save@decl \or \or \@classv \or \@classvi
  105.      \or \@classvii \or \@classviii  \or \@classix
  106.      \or \@classx \fi
  107.    \@lastchclass\@chclass}%
  108.    \ifcase\@lastchclass
  109.    \@acol \or
  110.    \or
  111.    \@acol \or
  112.    \@preamerr \thr@@ \or
  113.    \@preamerr \tw@ \@addtopreamble\@sharp \or
  114.    \or
  115.    \else  \@preamerr \@ne \fi
  116.    \def\the@toks{\the\toks}}
  117. \def\@classx{%
  118.   \ifcase \@lastchclass
  119.   \@acolampacol \or
  120.   \@addamp \@acol \or
  121.   \@acolampacol \or
  122.   \or
  123.   \@acol \@firstampfalse \or
  124.   \@addamp
  125.   \fi}
  126. \def\@classz{\@classx
  127.    \@tempcnta \count@
  128.    \prepnext@tok
  129.    \@addtopreamble{\ifcase \@chnum
  130.       \hfil
  131.       \d@llarbegin
  132.       \insert@column
  133.       \d@llarend \hfil \or
  134.       \hskip1sp\d@llarbegin \insert@column \d@llarend \hfil \or
  135.       \hfil\hskip1sp\d@llarbegin \insert@column \d@llarend \or
  136.    $\vcenter
  137.    \@startpbox{\@nextchar}\insert@column \@endpbox $\or
  138.    \vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or
  139.    \vbox \@startpbox{\@nextchar}\insert@column \@endpbox
  140.   \fi}\prepnext@tok}
  141. \def\@classix{\ifnum \@lastchclass = \thr@@
  142.        \@preamerr \thr@@ \fi
  143.        \@classx}
  144. \def\@classviii{\ifnum \@lastchclass >\z@
  145.       \@preamerr 4\@chclass 6 \@classvi \fi}
  146. \def\@arrayrule{\@addtopreamble \vline}
  147. \def\@classvii{\ifnum \@lastchclass = \thr@@
  148.    \@preamerr \thr@@ \fi}
  149. \def\@classvi{\ifcase \@lastchclass
  150.       \@acol \or
  151.       \@addtopreamble{\hskip \doublerulesep}\or
  152.       \@acol \or
  153.       \@classvii
  154.       \fi}
  155. \def\@classii{\advance \count@ \m@ne
  156.    \save@decl\prepnext@tok}
  157. \def\@classv{\save@decl
  158.    \@addtopreamble{\d@llarbegin\the@toks\the\count@\relax\d@llarend}%
  159.    \prepnext@tok}
  160. \def\@classi{\@classvi
  161.    \ifcase \@chnum \@arrayrule \or
  162.       \@classv \fi}
  163. \def\@startpbox#1{\bgroup
  164.   \hsize #1 \@arrayparboxrestore
  165.    \everypar{%
  166.       \vrule \@height \ht\@arstrutbox \@width \z@
  167.       \everypar{}}%
  168.    }
  169. \def\@endpbox{\@finalstrut\@arstrutbox \egroup\hfil}
  170. \def\@array[#1]#2{%
  171.   \@tempdima \ht \strutbox
  172.   \advance \@tempdima by\extrarowheight
  173.   \setbox \@arstrutbox \hbox{\vrule
  174.              \@height \arraystretch \@tempdima
  175.              \@depth \arraystretch \dp \strutbox
  176.              \@width \z@}%
  177.   \begingroup
  178.   \@mkpream{#2}%
  179.   \xdef\@preamble{\ialign \@halignto
  180.                   \bgroup \@arstrut \@preamble
  181.                           \tabskip \z@ \cr}%
  182.   \endgroup
  183.   \@arrayleft
  184.   \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi
  185.   \bgroup
  186.   \let \@sharp ##\let \protect \relax
  187.   \lineskip \z@
  188.   \baselineskip \z@
  189.   \m@th
  190.   \let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble}
  191. \newdimen \extrarowheight
  192. \extrarowheight=0pt
  193. \def\@arstrut{\unhcopy\@arstrutbox}
  194. \def\@arraycr{\relax\iffalse{\fi\ifnum 0=`}\fi
  195.   \@ifstar \@xarraycr \@xarraycr}
  196. \def\@xarraycr{\@ifnextchar [%
  197.   \@argarraycr {\ifnum 0=`{}\fi\cr}}
  198. \def\@argarraycr[#1]{\ifnum0=`{}\fi\ifdim #1>\z@
  199.   \expandafter\@xargarraycr\else
  200.   \expandafter\@yargarraycr\fi{#1}}
  201. \def\@xargarraycr#1{\unskip
  202.   \@tempdima #1\advance\@tempdima \dp\@arstrutbox
  203.   \vrule \@depth\@tempdima \@width\z@ \cr}
  204. \def\@yargarraycr#1{\cr\noalign{\vskip #1}}
  205. \def\multicolumn#1#2#3{%
  206.    \multispan{#1}\begingroup
  207.    \def\@addamp{\if@firstamp \@firstampfalse \else
  208.                 \@preamerr 5\fi}%
  209.    \@mkpream{#2}\@addtopreamble\@empty
  210.    \endgroup
  211.    \def\@sharp{#3}%
  212.    \@arstrut \@preamble
  213.    \null
  214.    \ignorespaces}
  215. \let\d@llarbegin\begingroup
  216. \let\d@llarend\endgroup
  217. \def\array{\col@sep\arraycolsep
  218.   \def\d@llarbegin{$}\let\d@llarend\d@llarbegin\gdef\@halignto{}%
  219.   \@tabarray}
  220. \def\@tabarray{\@ifnextchar[{\@array}{\@array[c]}}
  221. \def\tabular{\gdef\@halignto{}\@tabular}
  222. \expandafter\def\csname tabular*\endcsname#1{%
  223.       \gdef\@halignto{to#1}\@tabular}
  224. \def\@tabular{%
  225.   \leavevmode
  226.   \hbox \bgroup $\col@sep\tabcolsep \let\d@llarbegin\begingroup
  227.                                     \let\d@llarend\endgroup
  228.   \@tabarray}
  229. \def\endarray{\crcr \egroup \egroup \gdef\@preamble{}}
  230. \def\endtabular{\endarray $\egroup}
  231. \expandafter\let\csname endtabular*\endcsname=\endtabular
  232. \let\@ampacol=\relax        \let\@expast=\relax
  233. \let\@arrayclassiv=\relax   \let\@arrayclassz=\relax
  234. \let\@tabclassiv=\relax     \let\@tabclassz=\relax
  235. \let\@arrayacol=\relax      \let\@tabacol=\relax
  236. \let\@tabularcr=\relax      \let\@@endpbox=\relax
  237. \let\@argtabularcr=\relax   \let\@xtabularcr=\relax
  238. \def\@preamerr#1{\def\@tempd{{..} at wrong position: }%
  239.    \PackageError{array}{%
  240.    \ifcase #1 Illegal pream-token (\@nextchar): `c' used\or %0
  241.     Missing arg: token ignored\or                           %1
  242.     Empty preamble: `l' used\or                             %2
  243.     >\@tempd token ignored\or                               %3
  244.     <\@tempd changed to !{..}\or                            %4
  245.     Only one column-spec. allowed.\fi}\@ehc}                %5
  246. \def\newcolumntype#1{%
  247.   \edef\NC@char{\string#1}%
  248.   \@ifundefined{NC@find@\NC@char}%
  249.     {\@tfor\next:=<>clrmbp@!|\do{\if\noexpand\next\NC@char
  250.         \PackageWarning{array}%
  251.                        {Redefining primitive column \NC@char}\fi}%
  252.      \NC@list\expandafter{\the\NC@list\NC@do#1}}%
  253.     {\PackageWarning{array}{Column \NC@char\space is already defined}}%
  254.   \@namedef{NC@find@\NC@char}##1#1{\NC@{##1}}%
  255.   \@ifnextchar[{\newcol@{\NC@char}}{\newcol@{\NC@char}[0]}}
  256. \def\newcol@#1[#2]#3{\expandafter\@reargdef
  257.      \csname NC@rewrite@#1\endcsname[#2]{\NC@find#3}}
  258. \def\NC@#1{%
  259.   \@temptokena\expandafter{\the\@temptokena#1}\futurelet\next\NC@ifend}
  260. \def\NC@ifend{%
  261.   \ifx\next\relax
  262.     \else\@tempswatrue\expandafter\NC@rewrite\fi}
  263. \def\NC@do#1{%
  264.   \expandafter\let\expandafter\NC@rewrite
  265.     \csname NC@rewrite@\string#1\endcsname
  266.   \expandafter\let\expandafter\NC@find
  267.     \csname NC@find@\string#1\endcsname
  268.   \expandafter\@temptokena\expandafter{\expandafter}%
  269.         \expandafter\NC@find\the\@temptokena#1\relax}
  270. \def\showcols{{\def\NC@do##1{\let\NC@do\NC@show}\the\NC@list}}
  271. \def\NC@show#1{%
  272.   \typeout{Column #1\expandafter\expandafter\expandafter\NC@strip
  273.   \expandafter\meaning\csname NC@rewrite@#1\endcsname\@@}}
  274. \def\NC@strip#1:#2->#3 #4\@@{#2 -> #4}
  275. \newtoks\NC@list
  276. \newcolumntype{*}[2]{}
  277. \long\@namedef{NC@rewrite@*}#1#2{%
  278.   \count@#1
  279.   \loop
  280.   \ifnum\count@>\z@
  281.   \advance\count@\m@ne
  282.   \@temptokena\expandafter{\the\@temptokena#2}%
  283.   \repeat
  284.   \NC@find}
  285. \let\@xexpast\relax
  286. \let\@xexnoop\relax
  287. \def\save@decl{\toks \count@ = \expandafter\expandafter\expandafter
  288.                   {\expandafter\@nextchar\the\toks\count@}}
  289. \def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue
  290.    \let\@sharp\relax \let\@startpbox\relax \let\@endpbox\relax
  291.    \@temptokena{#1}\@tempswatrue
  292.    \@whilesw\if@tempswa\fi{\@tempswafalse\the\NC@list}%
  293.    \count@\m@ne
  294.    \let\the@toks\relax
  295.    \prepnext@tok
  296.    \expandafter \@tfor \expandafter \@nextchar
  297.     \expandafter :\expandafter =\the\@temptokena \do
  298.    {\@testpach
  299.    \ifcase \@chclass \@classz \or \@classi \or \@classii
  300.      \or \save@decl \or \or \@classv \or \@classvi
  301.      \or \@classvii \or \@classviii
  302.      \or \@classx
  303.      \or \@classx \fi
  304.    \@lastchclass\@chclass}%
  305.    \ifcase\@lastchclass
  306.    \@acol \or
  307.    \or
  308.    \@acol \or
  309.    \@preamerr \thr@@ \or
  310.    \@preamerr \tw@ \@addtopreamble\@sharp \or
  311.    \or
  312.    \else  \@preamerr \@ne \fi
  313.    \def\the@toks{\the\toks}}
  314. \let\@classix\relax
  315. \def\@classviii{\ifnum \@lastchclass >\z@\ifnum\@lastchclass=\tw@\else
  316.       \@preamerr 4\@chclass 6 \@classvi \fi\fi}
  317. \def\@classv{\save@decl
  318.    \expandafter\NC@ecs\@nextchar\extracolsep{}\extracolsep\@@@
  319.    \@addtopreamble{\d@llarbegin\the@toks\the\count@\relax\d@llarend}%
  320.    \prepnext@tok}
  321. \def\NC@ecs#1\extracolsep#2#3\extracolsep#4\@@@{\def\@tempa{#2}%
  322.   \ifx\@tempa\@empty\else\toks\count@={#1\tabskip#2\relax#3}\fi}
  323. \def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}
  324. \let\@@array\@array
  325. \def\endarray{\crcr \egroup \egroup \@arrayright \gdef\@preamble{}}
  326. \let\@arrayleft\@empty
  327. \let\@arrayright\@empty
  328. \newlength{\extratabsurround}
  329. \setlength{\extratabsurround}{2pt}
  330. \newlength{\backup@length}
  331. \newcommand{\firsthline}{%
  332.   \multicolumn1c{%
  333.     \global\backup@length\ht\@arstrutbox
  334.     \global\advance\backup@length\dp\@arstrutbox
  335.     \global\advance\backup@length\arrayrulewidth
  336.      \raise\extratabsurround\copy\@arstrutbox
  337.     }\\[-\backup@length]\hline
  338. }
  339. \newcommand{\lasthline}{\hline\multicolumn1c{%
  340.     \global\backup@length2\ht\@arstrutbox
  341.     \global\advance\backup@length2\dp\@arstrutbox
  342.     \global\advance\backup@length\arrayrulewidth
  343.     }\\[-\backup@length]%
  344.     \multicolumn1c{%
  345.        \lower\extratabsurround\copy\@arstrutbox
  346.        }%
  347. }
  348. \CheckCommand*\@xhline{\ifx\reserved@a\hline
  349.                \vskip\doublerulesep
  350.                \vskip-\arrayrulewidth
  351.              \fi
  352.       \ifnum0=`{\fi}}
  353. \renewcommand*\@xhline{\ifx\reserved@a\hline
  354.                \vskip\doublerulesep
  355.              \fi
  356.       \ifnum0=`{\fi}}
  357. \endinput
  358. %%
  359. %% End of file `array.sty'.
  360.